package com.wxb.controller;

import com.wxb.common.core.web.domain.AjaxResult;
import com.wxb.domain.MallHelpTypeEntity;
import com.wxb.domain.MallHelpIssueEntity;
import com.wxb.service.IMallHelpIssueService;
import com.wxb.service.IMallHelpTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Date 2025-05-30 13:58
 * @Version 1.0
 * @Description
 * @ClassName MallHelpIssueController
 **/
@RestController
@RequestMapping("/helpissue")
public class MallHelpIssueController {
    @Autowired
    private IMallHelpIssueService helpIssueService;
    @Autowired
    private IMallHelpTypeService helpTypeService;

    /**
     * 查看帮助类型列表
     */
    @PostMapping("/typeList")
    public Object typeList() {

        List<MallHelpTypeEntity> list = helpTypeService.queryList(new HashMap());

        return AjaxResult.success(list);
    }

    /**
     * 查看问题列表
     */
    @PostMapping("/issueList")
    public Object issueList(Long typeId) {

        Map<String, Object> params = new HashMap<>();
        params.put("typeId", typeId);
        List<MallHelpIssueEntity> helpIssueList = helpIssueService.queryList(params);

        return AjaxResult.success(helpIssueList);
    }
}
